package cn.zians.service.impl;

import cn.zians.dao.IEmployeeDao;
import cn.zians.domain.Employee;
import cn.zians.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 员工service实现类
 *
 * @Date 2020.8.27 10:40
 */

@Service("employeeService")
public class IEmployeeServiceImpl implements IEmployeeService {
    @Autowired
    private IEmployeeDao employeeDao;

    /**
     * Service查询所有员工信息
     *
     * @return
     * @throws Exception
     */
    @Override
    public List<Employee> findAll() throws Exception {
        return employeeDao.findAll();
    }

    /**
     * Service添加员工信息
     *
     * @param employee
     * @throws Exception
     */
    @Override
    public void addEmloyee(Employee employee) throws Exception {
        employeeDao.addEmloyee(employee);
    }

    /**
     * Service层删除员工信息
     *
     * @param id
     * @throws Exception
     */
    @Override
    public void deleteEmloyee(Integer id) throws Exception {
        employeeDao.deleteEmloyee(id);

    }

    /**
     * Service层更新员工信息
     *
     * @param employee
     * @throws Exception
     */
    @Override
    public void updateEmloyee(Employee employee) throws Exception {
        employeeDao.updateEmloyee(employee);
    }
}
